from pydantic import BaseModel
from sqlalchemy import Column, String, DateTime

from config import Base


class User(Base):
    __tablename__ = "user"

    uuid = Column(String,primary_key=True, unique=True, nullable=False)
    name = Column(String, nullable=False)
    password = Column(String, nullable=False)
    email = Column(DateTime, nullable=False)
    create_by = Column(String, nullable=False)
    create_time = Column(DateTime, nullable=False)
    update_by = Column(String, nullable=False)
    update_time = Column(DateTime, nullable=False)

class UserObj(BaseModel):
    uuid: str
    name: str
    password: str
    email: str
    create_by: str
    update_by: str
class UserCreate(BaseModel):
    name: str
    password: str
    email: str
class login(BaseModel):
    name: str
    password: str
class UserUuid(BaseModel):
    uuid: str
